package com.dog.basics.api.controller.common;


import com.dog.basics.bean.vo.api.sys.AboutUsVo;
import com.dog.basics.common.constant.SwaggerConstants;
import com.dog.basics.common.util.R;
import com.dog.basics.security.annotation.Inner;
import com.dog.basics.service.sys.ISysConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;


/**
 * 系统配置信息
 *
 * @author dog
 */
@RestController
@RequestMapping("/config/api")
@Api(value = "配置信息是万能的全api接口", tags = SwaggerConstants.API_ALL)
@AllArgsConstructor
@ApiIgnore
public class ApiConfigController {
    private final ISysConfigService sysConfigService;


    /**
     * @Author: wph
     * @Param: [code]
     * @Return: R<AboutUsVo>
     * @Date: 2019/12/17 11:43
     * 功能描述：根据code获取关于我们
     */
    @Inner
    @ApiOperation(value = "关于我们", notes = "根据Code获取配置信息(GYWM - 关于我们 )", tags = SwaggerConstants.API_MY)
    @ApiImplicitParam(name = "code", value = "配置CODE", required = true, paramType = "String")
    @GetMapping("/getInfoByCode/{code}")
    public R<AboutUsVo> getInfoByCode(@PathVariable("code") String code) {
        return R.ok(sysConfigService.getApiSysConfig(code));
    }


}
